<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:sec="http://www.springframework.org/security/tags"
      xmlns:c="http://java.sun.com/jsp/jstl/core">

    <h:head>
        <title>Modificacion del Libro Seleccionado</title>

        <style>
        body {
                width: 960px;
                margin: 40px auto;
                height:100%;
                font-size:14px;
                color:black;
                font-family:Arial, Helvetica, sans-serif;
                background-color: #708090;
            }
        </style>

        <script src="./jQuery/js/jquery-latest.pack.js" type="text/javascript"></script>
        <script src="./jQuery/js/jcarousellite_1.0.1c4.js" type="text/javascript"></script>
        <script src="./jQuery/js/jquery-1.4.4.min.js" type="text/javascript"></script>


        <script language="javascript" type="text/javascript" >
           function validarEmail() {
               var valor = document.getElementById("j_idt6:correo").value;
                if ((/[\w-\.]{3,}@([\w-]{2,}\.)*([\w-]{2,}\.)[\w-]{2,4}/.test(valor)) ){
                        alert("La dirección de email " + valor + " es correcta.")
                        return (true)
                } else {
                        alert("La dirección de email es incorrecta.");
                        return (false);
                }
            }
        </script>

    </h:head>
    <h:body>

        <p:growl autoUpdate="true" showDetail="true" />

        <p:panel id="pmod" header="#{msg.i_user}" > 
            <h:form onsubmit="return validarEmail()" >
                <table>
                    <tr>
                        <td>
                    <h:outputText value="#{msg.nickname}:" />
                    </td>
                    <td>
                    <h:outputText value="#{userAdmin.username}"/>
                    </td>
                    </tr>
                    <tr>
                        <td>
                    <h:outputText value="#{msg.nombre}:" />
                    </td>
                    <td>
                    <h:inputText value="#{userAdmin.nombre}" readonly="false"/>
                    </td>
                    </tr>
                    <tr>
                        <td>
                    <h:outputText value="#{msg.email}:" />
                    </td>
                    <td>
                    <h:inputText id="correo" value="#{userAdmin.correo}" readonly="false"/>
                    </td>
                    </tr>

                    <tr>
                        <td>
                    <p:commandButton value="#{msg.g_cambios}" action="irguardarUsuarios" ajax="false"  />
                    </td>
                    </tr>
                </table>
            </h:form>
        </p:panel>    
        <h:outputLink value="/index.html">#{msg.inicio}</h:outputLink>
    </h:body>
</html>